Two star test


In [1]:
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from scipy.integrate import odeint
from IPython.html.widgets import interact, interactive, fixed


:0: FutureWarning: IPython widgets are experimental and may change in the future.

In [2]:
from plotting_function import plotter

Reading data back from npz file


In [3]:
f = open('two_star_test_sol+ic.npz','r')
r = np.load('two_star_test_sol+ic.npz')
sol_test = r['arr_0']
ic_test = r['arr_1']
f.close()

I use interact on my plotter function to plot the positions of the stars and galaxies in my system at every time value, with a slider to choose which time value to view


In [4]:
interact(plotter,ic=fixed(ic_test),sol=fixed(sol_test),n=(0,len(np.linspace(0,1,80))-1,1));


As seen above, the disrupting galaxy follows the predicted parabolic orbit and the stars exhibit predicted behavior